

package com.hazelcast.map.impl.query;

import com.hazelcast.internal.util.HashUtil;

import java.io.Serializable;
import java.util.Objects;
import java.util.UUID;

public class CustomObject implements Serializable {

    private final String name;
    private final UUID uuid;
    private final CustomAttribute attribute;

    public CustomObject(String name, UUID uuid, CustomAttribute attribute) {
        this.name = name;
        this.uuid = uuid;
        this.attribute = attribute;
    }

    public String getName() {
        return name;
    }

    public UUID getUuid() {
        return uuid;
    }

    public CustomAttribute getAttribute() {
        return attribute;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CustomObject that = (CustomObject) o;
        if (!Objects.equals(attribute, that.attribute)) {
            return false;
        }
        if (!Objects.equals(name, that.name)) {
            return false;
        }
        return Objects.equals(uuid, that.uuid);
    }

    @Override
    public int hashCode() {
        return HashUtil.hashCode(name, uuid, attribute);
    }
}
